<script lang="ts" setup>
import { defineProps, ref } from 'vue'
defineProps(['title', 'showBack'])
</script>
<template>
  <header class="text-center">
    {{ title }}
    <template v-if="showBack">
      <router-link to="/"
        ><button class="btn-back">
          <el-icon color="#448ACA" :size="18"><House /></el-icon></button
      ></router-link>
    </template>
    <!-- 定义一个作用域插槽  用来放LineType -->
    <slot name="lineType"></slot>
    <Current />
  </header>
</template>
<style>
header {
  width: 100%;
  height: 66px;
  background: url('../assets/header-bg.png') no-repeat center center;
  background-size: 100% 100%;
  font-size: 30px;
  line-height: 66px;
  color: #fff;
  letter-spacing: 2px;
}
.btn-back {
  position: absolute;
  display: flex;
  width: 36px;
  height: 36px;
  left: 14px;
  top: 11px;
  align-items: center;
  justify-content: center;
  border: 1px solid #448aca;
  border-radius: 50%;
}
.line-type {
  position: absolute;
  left: 63px;
  top: 14px;
}
</style>
